<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">

	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>Insert title here</title>
	</head>
	<body>
	<a4j:form id="form">
		
		<h:messages id="mensagens" globalOnly="true"></h:messages>
		<br />
				*Nome:
				<h:inputText id="nome" value="#{usuarioBean.usuario.nome}"
			required="true" requiredMessage="Campo obrigatório">
		</h:inputText>
		<rich:message for="nome" />
		<br />
			*Sobrenome:
				<h:inputText id="sobrenome" value="#{usuarioBean.usuario.sobreNome}"
			required="true" requiredMessage="Campo obrigatório">
		</h:inputText>
		<rich:message for="sobrenome" />
		<br />
		
			*Data de Nascimento:
				<rich:calendar id="dataNascimento"
			value="#{usuarioBean.usuario.dataNascimento}" required="true"
			requiredMessage="Campo obrigatório" datePattern="dd/MM/yyyy">
		</rich:calendar>
		<rich:message for="dataNascimento" />
		<br />
		
		*email:
				<h:inputText id="email" value="#{usuarioBean.usuario.email}"
			required="true" requiredMessage="Campo obrigatório">
			<f:validator validatorId="emailValidator" />
		</h:inputText>
		<rich:message for="email" />
		<br />
				*Login:
				<h:inputText id="login" value="#{usuarioBean.usuario.login}"
			required="true" requiredMessage="Campo obrigatório">
		</h:inputText>
		<rich:message for="login" />
		<br />
		
		*Senha:
		<h:inputSecret id="senha" value="#{usuarioBean.usuario.senha}"
			required="true" requiredMessage="Campo obrigatório">
		</h:inputSecret>
		<rich:message for="senha" />
		<br />
		*Confirmar senha:
		<h:inputSecret id="confirmaSenha"
			value="#{usuarioBean.senhaConfirmacao}" required="true"
			requiredMessage="Campo obrigatório">
			<f:validator validatorId="passwordValidator" />
			<f:attribute name="senhaId" value="form:senha" />
		</h:inputSecret>
		<rich:message for="confirmaSenha" />
		<br />
		<h:outputText value="*Role:" rendered="#{authenticatorBean.admin}" />

		<h:selectOneMenu id="cbRole" converter="genericConverter"
			value="#{usuarioBean.role}" required="true"
			requiredMessage="Campo obrigatório" rendered="#{authenticatorBean.admin}">
			<f:selectItem itemLabel="Escolha" />
			<f:selectItems value="#{suportBean.roleSelect}" />
		</h:selectOneMenu>
		<br />
		<a4j:commandButton id="salvar" value="salvar" type="submit"
			action="#{usuarioBean.save}" reRender="tabPanel,form">
		</a4j:commandButton>

	</a4j:form>
	</body>
</ui:composition>